#include<iostream>
#include"udp_client.hpp"
int main(int argc,char* argv[]){
    if(argc!=3){
        std::cout<<"Usage: "<<argv[0]<<" ip_address port"<<std::endl;
        return -1;
    }
    std::string ip_address=argv[1];
    uint16_t port=atoi(argv[2]);
    UdpClient client(ip_address,port);
    std::string message;
    while(true){
        std::cin>>message;
        client.Send(message);
        std::cout<<client.Recv()<<std::endl;
    }
    return 0;
}